import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/zh/login/index.vue'
import Layout from '@/views/zh/layout/index.vue'
import Category from '@/views/zh/category/index.vue'
import Home from '@/views/zh/home/index.vue'
import Detail from '@/views/zh/detail/index.vue'
import CartList from '@/views/zh/cartList/index.vue'
import CheckOut from '@/views/zh/checkOut/index.vue'
//import Address from '@/views/zh/checkOut/address.vue'
import Pay from '@/views/zh/pay/index.vue'
import Tax from '@/views/zh/tax/index.vue'
import Again from '@/views/zh/pay/again.vue'
import Member from '@/views/zh/member/index.vue'
import MemberInfo from '@/views/zh/member/components/userInfo.vue'
import MemberOrder from '@/views/zh/member/components/userOrder.vue'
import MemberAddress from '@/views/zh/member/components/userAddress.vue'
import OrderSection from '@/views/zh/member/components/orderSection.vue'

//韩文
import KrLayout from '@/views/kr/layout/index.vue'
import KrHome from '@/views/kr/home/index.vue'

const router = createRouter({
  //history: createWebHistory(import.meta.env.BASE_URL),

  history: createWebHistory(),
  routes: [
    {
      path: '/',
      component:Layout,
      meta:{title:'网站首页'},
      children:[
        {path: '',meta:{title:'产品'},component: Home},
        {path: 'category/:id',meta:{title:'产品'},component: Category},
        {path: 'detail/:id',meta:{title:'产品'},component: Detail},
        {path: 'cartlist',meta:{title:'购物车'},component: CartList},
        {path: 'checkout',meta:{title:'订单'},component: CheckOut},
        {path: 'pay',meta:{title:'支付'},component: Pay},
        {path: 'again',meta:{title:'支付'},component: Again},
        {path: 'tax',meta:{title:'税金计算'},component: Tax},
        {
          path: 'member',
          name: 'member',
          component: Member,
          children: [
            {path: '',component: MemberInfo,meta:{title:'会员中心'}},
            {path: 'order',component: MemberOrder,meta:{title:'订单'}},
            {path: 'address',component: MemberAddress,meta:{title:'地址'}},
            {path: 'order_section',component: OrderSection,meta:{title:'地址'}},
          ]
        },
      ]
    },
    {
      path: '/login',
      meta:{title:'登录'},
      component: Login
    },
    {
      path: '/kr_index',
      meta:{title:'웹 사이트 첫 페이지'},
      component: KrLayout,
      children:[
        {path: '/kr_index',name: 'kr_home',component: KrHome},
      ]
    },
  ]
})

export default router
